package com.jeesite.modules.warehousearea.enums;

import lombok.Getter;

/**
 * @author zp
 * @version v1.0.0
 * @Description : TODO
 * @Create on : 2025/4/9
 **/
@Getter
public enum WarehouseAreaSourceTypeEnum {

	SOURCE_TYPE_1("1", "手工新增"),
	SOURCE_TYPE_2("2", "ERP"),
	;

	private String code;
	private String name;

	WarehouseAreaSourceTypeEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public static String getName(String code) {
		for (WarehouseAreaSourceTypeEnum c : WarehouseAreaSourceTypeEnum.values()) {
			if (c.getCode().equals(code)) {
				return c.name;
			}
		}
		return null;
	}

	public static String getCode(String name) {
		for (WarehouseAreaSourceTypeEnum c : WarehouseAreaSourceTypeEnum.values()) {
			if (c.getName().equals(name)) {
				return c.code;
			}
		}
		return null;
	}
}
